<h1>My projects</h1>

<div id="content">
	<% if @projects.blank? %>
		<p>There are no projects for you, create a 
		<%= link_to 'new', new_project_path %>!</p>
	<% else %>

	<table>
		<tr>
			<th></th>
			<th>Title</th>
			<th>Budget</th>
			<th></th>
		</tr>
	<% for project in @projects %>
		<tr>
			<td><img src="/images/project-closed-<%=h project.closed %>.png" alt="project state logo "></td>
			<td><%= link_to h(truncate(project.title, 20)), project %></td>
			<td><%=number_to_currency( project.budget, :unit=> h(project.currency), :format => "%n %u") %></td>
			<td>
				<%= link_to 'Edit', edit_project_path(project) %> |
				<%= link_to 'Destroy', project, :confirm => 'Are you sure?', :method => :delete %>
			</td>
		</tr>
	<% end %>
	</table>
	<% end %>
	<p><%= link_to 'New project', new_project_path %></p>
</div>
